<div class="products">
    <div class="products-title">
        <h3><?php echo $this->msg; ?></h3>
    </div>
    <?php
    $sale = new Default_Models_Sale();
    $pro = new Default_Models_Product();
    $rows = $this->salePro;
    $url = $db->getCurrentUrl();
    $objPaging = new Libs_Paging($url, $rows, ITEM_PP);
    $rows = $objPaging->getRecords();
    if (!empty($rows)) {
        foreach ($rows as $pro) {
            ?>
            <div class="product">
                <a href="<?php echo URL_BASE; ?>/product/detail/<?php echo $pro->getProId(); ?>">
                    <img src="<?php echo URL_BASE . DS . $pro->getThumb(); ?>" />
                    <div class="mini-tags">
                        <?php
                        if (round((strtotime($db->getCurrentTime()) - strtotime($pro->getPostDate())) / (60 * 60)) <= 24) {
                            ?>
                            <span class="inew"></span>
                            <?php
                        }
                        ?>
                        <?php
                        if (strtotime($db->getCurrentTime()) - strtotime($sale->getSaleByProId($pro->getProId())) < 0) {
                            ?>
                            <span class="isale"></span>
                            <?php
                        }
                        ?>
                    </div>
                </a>
                <a href="<?php echo URL_BASE; ?>/product/detail/<?php echo $pro->getProId(); ?>"><h4><?php echo $pro->getName(); ?></h4></a>
                <p><?php echo number_format($pro->getPrice(), 0, ',', '.') . " VNĐ"; ?></p>
            </div>
            <?php
        }
        echo $objPaging->getPaging();
    } else {
        echo "Không có sản phẩm nào";
    }
    ?>
</div>